package com.gywj.race.controller.api;

import com.gywj.race.config.result.AjaxResultHandler;
import com.gywj.race.entity.AlumniAssociation;
import com.gywj.race.service.AlumniAssociationService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * The type Alumni association controller.
 */
@RestController
public class AlumniAssociationController {
    @Resource
    private AlumniAssociationService alumniAssociationService;

    /**
     * Gets alumni association list.
     *
     * @return the alumni association list
     */
    @PostMapping("/alumniAssociation/list")
    public Map<String, Object> getAlumniAssociationList() {
        try {
            List<AlumniAssociation> eventAlumniAssociation = alumniAssociationService.getAlumniAssociationList();
            return AjaxResultHandler.Success("成功", eventAlumniAssociation);
        } catch (Exception e) {
            return AjaxResultHandler.Failed(e.getMessage());
        }
    }
}
